/// *
// * To change this template, choose Tools | Templates
// * and open the template in the editor.
// */
//package main_com.Controlers.friend.old;
//
//import jakarta.servlet.http.HttpServletRequest;
//import jakarta.servlet.http.HttpServletResponse;
//import jakarta.servlet.http.HttpSession;
//import main_com.mapper.FriendMapper;
//import main_com.pojo.LoginBean;
//import main_com.pojo.LookFriendBean;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//
//import java.util.ArrayList;
//
///**
// * @author Administrator
// */
//@Controller
//@RequestMapping("/LookFriendControllerOld")
//public class LookFriendController {
//    //    public void wrong1(){
////        String msg="不允许有空，注册失败！";
////        int type=JOptionPane.YES_NO_CANCEL_OPTION;
////        String title="信息提示";
////        JOptionPane.showMessageDialog(null, msg, title, type);
////    }
//    @Autowired
//    FriendMapper friendMapper;
//
//    @RequestMapping("/lookFriendOld")
//    protected void lookFriend(HttpServletRequest request, HttpServletResponse response) {
//        try {
//            String userName = "";
//            HttpSession session = request.getSession();
//            ArrayList login = (ArrayList) session.getAttribute("login");
//            if (login == null || login.size() == 0) {
//                response.sendRedirect("http://localhost/login.jsp");
//                return;
//            } else {
//                for (int i = login.size() - 1; i >= 0; i--) {
//                    LoginBean nn = (LoginBean) login.get(i);
//                    userName = nn.getUserName();
//                }
//            }
//            if (session.getAttribute("friendslist") == null) {
//                ArrayList<LookFriendBean> friendslist = friendMapper.getFriendByUserName(userName);
//                session.setAttribute("friendslist", friendslist);
//            }
//            response.sendRedirect("http://localhost/friendManager/lookFriend.jsp");
//        } catch (Exception e) {
//            e.printStackTrace();
//        }
//    }
//
//}